<template>
	<view>
		<mytop></mytop>
		<view class="content"> 
			<view class="item" v-for="item in shoplist" :key="item.id" @tap="goto(item.id)">
				<image :src="`https://elm.cangdu.org/img/${item.image_path}`" mode=""></image>
				<p>{{item.name}}</p>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shoplist:[], //商店列表
			}
		},
		methods: {
			goto(id){
				// 跳转普通页面
				uni.navigateTo({
					url:"/pages/detail/detail?id=" + id
				})
			}
		},
		onLoad() {
			uni.request({
				url:"https://elm.cangdu.org/shopping/restaurants?latitude=31.22967&longitude=121.4762"
			}).then(res=>{
				console.log(res);
				this.shoplist = res[1].data;
			})
		}
	}
</script>

<style>

</style>
